<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This file documents the use of the GNU compilers.

Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Function Specific Option Pragmas (Using the GNU Compiler Collection (GCC))</title>

<meta name="description" content="Function Specific Option Pragmas (Using the GNU Compiler Collection (GCC))">
<meta name="keywords" content="Function Specific Option Pragmas (Using the GNU Compiler Collection (GCC))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Indices.html" rel="index" title="Indices">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Pragmas.html" rel="up" title="Pragmas">
<link href="Loop_002dSpecific-Pragmas.html" rel="next" title="Loop-Specific Pragmas">
<link href="Push_002fPop-Macro-Pragmas.html" rel="prev" title="Push/Pop Macro Pragmas">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
kbd.key {font-style: normal}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en_US">
<div class="subsection-level-extent" id="Function-Specific-Option-Pragmas">
<div class="nav-panel">
<p>
Next: <a href="Loop_002dSpecific-Pragmas.html" accesskey="n" rel="next">Loop-Specific Pragmas</a>, Previous: <a href="Push_002fPop-Macro-Pragmas.html" accesskey="p" rel="prev">Push/Pop Macro Pragmas</a>, Up: <a href="Pragmas.html" accesskey="u" rel="up">Pragmas Accepted by GCC</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Function-Specific-Option-Pragmas-1"><span>6.62.15 Function Specific Option Pragmas<a class="copiable-link" href="#Function-Specific-Option-Pragmas-1"> &para;</a></span></h4>

<dl class="table">
<dt><a id="index-pragma-GCC-target"></a><span><code class="code">#pragma GCC target (<var class="var">string</var>, &hellip;)</code><a class="copiable-link" href="#index-pragma-GCC-target"> &para;</a></span></dt>
<dd>
<p>This pragma allows you to set target-specific options for functions
defined later in the source file.  One or more strings can be
specified.  Each function that is defined after this point is treated
as if it had been declared with one <code class="code">target(</code><var class="var">string</var><code class="code">)</code>
attribute for each <var class="var">string</var> argument.  The parentheses around
the strings in the pragma are optional.  See <a class="xref" href="Function-Attributes.html">Declaring Attributes of Functions</a>,
for more information about the <code class="code">target</code> attribute and the attribute
syntax.
</p>
<p>The <code class="code">#pragma GCC target</code> pragma is presently implemented for
x86, ARM, AArch64, PowerPC, S/390, and Nios II targets only.
</p>
</dd>
<dt><a id="index-pragma-GCC-optimize"></a><span><code class="code">#pragma GCC optimize (<var class="var">string</var>, &hellip;)</code><a class="copiable-link" href="#index-pragma-GCC-optimize"> &para;</a></span></dt>
<dd>
<p>This pragma allows you to set global optimization options for functions
defined later in the source file.  One or more strings can be
specified.  Each function that is defined after this point is treated
as if it had been declared with one <code class="code">optimize(</code><var class="var">string</var><code class="code">)</code>
attribute for each <var class="var">string</var> argument.  The parentheses around
the strings in the pragma are optional.  See <a class="xref" href="Function-Attributes.html">Declaring Attributes of Functions</a>,
for more information about the <code class="code">optimize</code> attribute and the attribute
syntax.
</p>
</dd>
<dt><a class="index-entry-id" id="index-pragma-GCC-pop_005foptions"></a>
<a id="index-pragma-GCC-push_005foptions"></a><span><code class="code">#pragma GCC push_options</code><a class="copiable-link" href="#index-pragma-GCC-push_005foptions"> &para;</a></span></dt>
<dt><code class="code">#pragma GCC pop_options</code></dt>
<dd>
<p>These pragmas maintain a stack of the current target and optimization
options.  It is intended for include files where you temporarily want
to switch to using a different &lsquo;<samp class="samp">#pragma GCC target</samp>&rsquo; or
&lsquo;<samp class="samp">#pragma GCC optimize</samp>&rsquo; and then to pop back to the previous
options.
</p>
</dd>
<dt><a id="index-pragma-GCC-reset_005foptions"></a><span><code class="code">#pragma GCC reset_options</code><a class="copiable-link" href="#index-pragma-GCC-reset_005foptions"> &para;</a></span></dt>
<dd>
<p>This pragma clears the current <code class="code">#pragma GCC target</code> and
<code class="code">#pragma GCC optimize</code> to use the default switches as specified
on the command line.
</p>
</dd>
</dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Loop_002dSpecific-Pragmas.html">Loop-Specific Pragmas</a>, Previous: <a href="Push_002fPop-Macro-Pragmas.html">Push/Pop Macro Pragmas</a>, Up: <a href="Pragmas.html">Pragmas Accepted by GCC</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
